import request from "@/api/request";

//创建文章
export const creatarticle = (value: any) => {
    return request({
        method: "post",
        url: "rest/article",
        data: value,
    });
};

//获取文章列表数据
export const getArticle = () => {
    return request({
        method: "get",
        url: "rest/article",
    });
};


//获取被编辑文章的详情
export const getEditArticle = (id:string[] | string) => {

    return request({
        method:'get',
        url:`rest/article/${id}`
    })
}

//更新文章数据
export const upDateArticle = (id:string | string[],data:any) => {
    return request({
        method:'put',
        url:`rest/article/${id}`,
        data:data,
    })
}

//删除文章
export const deletArticle = (id:string | string[]) => {
    return request({
        method:'delete',
        url:`rest/article/${id}`
    })
}